Object Revision

Hello everybody

How is it possible to have for an object a revision number, which automatically counts up when something in the object has been changed?

Regards Christoph

 


guntermc - Thu May 21 04:14:39 EDT 2015

Re: Object Revision
Mike.Scharnow - Thu May 21 07:32:25 EDT 2015

you can define an object attribute "Revision Number" and program and roll out an object trigger. There are some posts in the DXL forum, e.g. https://www.ibm.com/developerworks/community/forums/html/topic?id=92e79994-8983-4ff0-b44e-36cf31c97264&ps=100 describes how to set up such a trigger, this can be adopted for your purposes.

 

Note that you do not want a revision number which increments if anything has changed in the object, but if some attributes excluding the revision number have changed :-).

But I would advise against such a trigger. Usually a user will update a requirement several times until he is satisfied with the result. If you had an automated revision number, you would end up with a huge differences in the revision number of objects from one baseline to the next. Better work with dates and check whether the requirement has changed since the last baseline.

Re: Object Revision
guntermc - Wed May 27 11:07:50 EDT 2015

Mike.Scharnow - Thu May 21 07:32:25 EDT 2015

you can define an object attribute "Revision Number" and program and roll out an object trigger. There are some posts in the DXL forum, e.g. https://www.ibm.com/developerworks/community/forums/html/topic?id=92e79994-8983-4ff0-b44e-36cf31c97264&ps=100 describes how to set up such a trigger, this can be adopted for your purposes.

 

Note that you do not want a revision number which increments if anything has changed in the object, but if some attributes excluding the revision number have changed :-).

But I would advise against such a trigger. Usually a user will update a requirement several times until he is satisfied with the result. If you had an automated revision number, you would end up with a huge differences in the revision number of objects from one baseline to the next. Better work with dates and check whether the requirement has changed since the last baseline.

Thanks for the reply so far!

Is this code also available for DXL attributes where the trigger definition is also in there?

In general I would like to have an attribute called "Counter" which counts up when the enumerated attribute status leaves the state "Approved". An this per object, thats the reason why I would like to have a DXL attribute. Is there a solution as simple as possible?

Regards Christoph

Re: Object Revision
llandale - Thu May 28 16:54:15 EDT 2015

If you are not persnickety about the format of your revision numbers and you don't care if rev "1399" is followed by rev "1788", you can do the following:

Write a "dxl_ObjRevision" attrDXL.  It plows through History of the object, remembers the last such history, gets the "session" number from that History, and displays the session number.  You have a problem getting the session for objects that lack History; you need to open the previous baseline, find the corresponding object, and look at its History.  This could get really sticky for objects that never change (e.g. 1  Scope) but you could also have a hidden backup string attribute to house the last known Revision; giving a mechanism for Revisions to propagate through baselines.  This string attribute needs to be erased when the object actually has History.  Maybe a background batch job at night can keep up with the "lastKnownRevision" of the objects.

-Louie